﻿using System;
using System.Collections.Generic;
using System.Text;

namespace EdgeStatz.Controls
{
    public class AvailabilityContact
    {
        string name;
        bool selected;
        AvailabilityTaskCollection tasks;

        public bool Selected
        {
            get { return selected; }
            set { selected = value; }
        }
        public AvailabilityTaskCollection Tasks
        {
            get { return tasks; }
            set { tasks = value; }
        }
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public AvailabilityContact(string name)
        {
            this.name = name;
            this.tasks = new AvailabilityTaskCollection();
            this.selected = false;
        }
    }

    public class AvailabilityContactCollection : IList<AvailabilityContact>, ICollection<AvailabilityContact>, IEnumerable<AvailabilityContact>
    {
        private List<AvailabilityContact> contacts = new List<AvailabilityContact> { };

        public int Count { get { return contacts.Count; } }

        public bool IsReadOnly { get { return false; } }

        public AvailabilityContact this[int index] { get { return contacts[index]; } set { contacts[index] = value; } }

        public void Add(AvailabilityContact value) { contacts.Add(value); }

        public void Clear() { contacts.Clear(); }

        public bool Contains(AvailabilityContact value) { return contacts.Contains(value); }

        public void CopyTo(AvailabilityContact[] array, int arrayIndex) { contacts.CopyTo(array, arrayIndex); }

        public int IndexOf(AvailabilityContact value) { return contacts.IndexOf(value); }

        public void Insert(int index, AvailabilityContact value) { contacts.Insert(index, value); }

        public bool Remove(AvailabilityContact value) { return contacts.Remove(value); }

        public void RemoveAt(int index) { contacts.RemoveAt(index); }

        public IEnumerator<AvailabilityContact> GetEnumerator() { return contacts.GetEnumerator(); }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return contacts.GetEnumerator(); }
    }
}
